package com.bianyuanren.v4.controller.qiniu;

import com.bianyuanren.common.core.domain.AjaxResult;
import com.bianyuanren.v4.utils.QiniuTokenUtils;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * 七牛文件上传
 * @author 微笑的你
 * @version 1.0
 * @date 2020/5/4 0004 下午 5:00
 */
@Controller
@RequestMapping("/api/qiniu")
public class QiniuTokenController {

    /**
     * 获取七牛云的token
     */
    @PostMapping("/token")
    @ResponseBody
    public AjaxResult token() {
        String token = QiniuTokenUtils.getToken();
        return AjaxResult.success("七牛云token",token);
    }

    /**
     * 七牛云图片鉴黄
     */
    @PostMapping("/picture")
    @ResponseBody
    public AjaxResult picture(String picture) {
        //返回true为图片正常
        Boolean pornography = QiniuTokenUtils.pornography(picture);
        return AjaxResult.success("七牛云图片",pornography);
    }

    /**
     * 七牛云视屏鉴黄
     */


    /**
     * 七牛云视屏截取第一帧
     */


    /**
     * 七牛人脸识别
     */



}
